package com.example.job_backend.model.Query;

import com.sushengren.easyword.annotation.WordProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class ResumeRequest {
    // 基础信息
    private Integer templateId;
    private Integer studentId;
    private String resumeName;
    @WordProperty("姓名")
    private String name;
    @WordProperty("民族")
    private String Ethnicity;
    @WordProperty("身高")
    private String Height;
    @WordProperty("住址")
    private String Address;

    @WordProperty("出生年月")
    private String birthDate;

    @WordProperty("电话")
    private String phone;
    @WordProperty("政治面貌")
    private String politicalStatus;
    @WordProperty("邮箱")
    private String email;
    @WordProperty("毕业院校")
    private String school;
    @WordProperty("学历")
    private String education;

    // 动态列表
    @WordProperty("教育背景")
    private List<EducationDTO> educations;
    @WordProperty("实习经历")
    private List<InternshipDTO> internships;
    @WordProperty("校园经历")
    private List<CampusDTO> campuses;

    // 自我评价
    @WordProperty("自我评价")
    private String selfEvaluation;

    // 教育经历嵌套类
    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    public static class EducationDTO {
        @WordProperty("教育日期")
        private String startDate;
        @WordProperty("结束日期")
        private String endDate;

        @WordProperty("院校")
        private String school;
        @WordProperty("专业")
        private String major;
        @WordProperty("主修课程")
        private String courses;
    }

    // 实习经历嵌套类
    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    public static class InternshipDTO {
        @WordProperty("实习日期")
        private String startDate;

        @WordProperty("结束日期")
        private String endDate;

        @WordProperty("企业")
        private String company;
        @WordProperty("岗位")
        private String position;
        @WordProperty("主要工作")
        private String responsibilities;
    }

    // 校园经历嵌套类
    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    public static class CampusDTO {
        @WordProperty("日期")
        private String startDate;

        @WordProperty("结束日期")
        private String endDate;

        @WordProperty("经历")
        private String activityName;
        @WordProperty("角色")
        private String role;
        @WordProperty("备注")
        private String description;
    }

    // 添加一个获取“年月日”的方法
    public String getBirthDateYMD() {
        if (birthDate == null || birthDate.length() < 10) {
            return birthDate; // 避免空指针或格式错误
        }
        return birthDate.substring(0, 10); // 直接截取前10位：2025-05-06
    }
}